#include <bits/stdc++.h>
using namespace std;
const int M = 15, N = 1e2 + 5;
int n, k;
int R[M], p[M];
double dp[N][1 << M];

int main() {
    cin >> k >> n;
    for (int i = 0, r; i < n; i++) {
        cin >> p[i];
        while (cin >> r, r) R[i] |= 1 << (r - 1);
    }
    for (int i = 1; i <= k; i++)
        for (int S = 0; S < 1 << n; S++) {
            for (int j = 0; j < n; j++)
                if ((R[j] & S) != R[j]) dp[i][S] += dp[i - 1][S];
                else dp[i][S] += max(dp[i - 1][S], p[j] + dp[i - 1][S | 1 << j]);
            dp[i][S] /= n;
        }
    printf("%.6lf", dp[k][0]);
    return 0;
}
